package appconfig

import (
	"github.com/spf13/viper"
	"log"
)

type Appconfig struct {
	Mysql
	Redis
}
type Mysql struct {
	User     string
	Password string
	Host     string
	Port     string
	Database string
}
type Redis struct {
	Password string
	Host     string
	Port     string
}

var ConfigData Appconfig

func Init() {
	viper.SetConfigFile("appconfig/config.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&ConfigData)
	log.Println(ConfigData)
}
